<template>
    <div>
        <nt-row class="title_main">
            <nt-col :span="12">银行账户受益人备案</nt-col>
            <nt-col :span="12" align="right">
                <nt-button type="primary" @click="addBeneficiary">+添加受益人备案</nt-button>
            </nt-col>
        </nt-row>
        <nt-table :data="accountList" class="dialog_table mT24">
            <nt-table-column label="ID">
                <template scope="scope">
                    <p v-if="scope.row.id">{{scope.row.id}}</p>
                    <p v-else> - </p>
                </template>

            </nt-table-column>
            <nt-table-column label="法律主体名">
                <template scope="scope">
                    <p v-if="scope.row.legal_entity_name">{{scope.row.legal_entity_name}}</p>
                    <p v-else> - </p>
                </template>
            </nt-table-column>
            <nt-table-column label="法律主体所在地区">
                <template scope="scope">
                    <p v-if="scope.row.legal_entity_region">{{scope.row.legal_entity_region}}</p>
                    <p v-else> - </p>
                </template>
            </nt-table-column>
            <nt-table-column label="审核状态">
                <template scope="scope">
                    <p v-if="scope.row.verification_status">{{scope.row.verification_status}}</p>
                    <p v-else> - </p>
                </template>
            </nt-table-column>
        </nt-table>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                accountList: []
            }
        },
        mounted() {
            this.requestGetLegalEntities();
        },
        methods: {
            addBeneficiary() {
                this.$router.push('/main/verified');
            }
            ,
            //接口请求---查询实名认证信息列表
            async requestGetLegalEntities() {
                let params = {};
                params.accountId = this.ctx.store.get('account_id');

                let accountListData = await this.ctx.models.settlement.getLegalEntities(params, this.ctx);
                if (accountListData.statusCode == 200) {
                    this.accountList = accountListData.data;
                }
            },
        }
    }
</script>

<style scoped>
    .add_bank_card_page {
        width: 800px;
        height: 30px;
        margin: 10px auto;
    }
</style>